﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DotNetNuke.Entities.Modules;

namespace HyperCrunch.Druid.Sample
{
    
    public class BusinessController
    {
        public ProductCollection GetProducts(int moduleId)
        {
            // For this example module, we ignore the module ID since we are using a single XML file for all instances of the module

            return ProductModel.GetProducts();
        }

        public void AddProduct(int moduleId, Product productInfo)
        {
            // For this example module, we ignore the module ID since we are using a single XML file for all instances of the module

            ProductModel.UpdateProduct(String.Empty, productInfo);
        }

        public void UpdateProduct(int moduleId, string productId, Product productInfo)
        // For this example module, we ignore the module ID since we are using a single XML file for all instances of the module
        {
            ProductModel.UpdateProduct(productId, productInfo);
        }

        public void DeleteProduct(int moduleId, string productId)
        {
            // For this example module, we ignore the module ID since we are using a single XML file for all instances of the module

            ProductModel.DeleteProduct(productId);
        }
    }

}